package com.zzyl.mapper;


import com.zzyl.dto.ProjectPlanDto;
import com.zzyl.entity.ProjectPlan;
import com.zzyl.vo.ProjectPlanVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProjectPlanMapper {

    /**
     * 新增护理项目到护理计划
     * @param projectPlans
     */
     void batchInsert(List<ProjectPlan> projectPlans);

    /**
     * 根据id查询project
     * @param id
     * @return
     */
    @Select("select pp.*,np.name projectName from nursing_project_plan pp left join nursing_project np on pp.project_id = np.id where plan_id = #{id}")
    List<ProjectPlanVo> getById(Integer id);

    /**
     * 根据id删除护理项目
     * @param id
     */
    @Delete("delete from nursing_project_plan where id = #{id} ")
    void batchDel(Integer id);
}
